import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:screen/screen.dart';
import 'package:xunlongchi/bloc/time_bloc.dart';
import 'package:xunlongchi/ui/splash_page.dart';

void main() async {
  runApp(const MyApp());

  //状态栏透明
  SystemUiOverlayStyle systemUiOverlayStyle =
      SystemUiOverlayStyle(statusBarColor: Colors.transparent);
  SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);

  SystemChrome.setEnabledSystemUIOverlays([]);

  await Screen.keepOn(true);
}

class MyApp extends StatelessWidget {
  const MyApp({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return BlocProvider(
      create: (_) => TimeBloc(),
      child: MaterialApp(
        debugShowCheckedModeBanner: false,
        title: '寻龙尺',
        home: const SplashPage(),
      ),
    );
  }
}
